Skip to content

Document Python import style guidelines in AGENTS.md - #299

Open
Bernhard Merkle (bmerkle) wants to merge 2 commits into
microsoft:mainfrom
bmerkle:fix-import-style
Open

Document Python import style guidelines in AGENTS.md#299
Bernhard Merkle (bmerkle) wants to merge 2 commits into
microsoft:mainfrom
bmerkle:fix-import-style

Conversation

@bmerkle

Copy link
Copy Markdown
Collaborator

Summary

Docs-only change, no code affected.

Test plan

  • N/A (documentation only)

…and PR microsoft#198

- bump pyright version to 1.1.411, and
- adjust uv_build requirement
- small reformatting of answers.py
Codifies the module-qualified-by-default convention discussed in
issue microsoft#112, to guide the follow-up import-consistency cleanup.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the project’s preferred Python import style in AGENTS.md as groundwork for future import-consistency cleanup work, but also includes a few unrelated dependency/code formatting updates.

Changes:

  • Add a “Python Import Style Guidelines” section to AGENTS.md (module-qualified by default; limit direct-symbol imports; forbid wildcard imports).
  • Add a new date/time range guideline (half-open intervals) to AGENTS.md.
  • Bump pyright (and related lockfile entries) and widen the uv_build upper bound; reorder one stdlib import in answers.py.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
AGENTS.md Adds documented Python import-style rules (and an additional date/time range guideline).
pyproject.toml Updates build-system constraint and dev dependency minimum for pyright.
uv.lock Updates the locked pyright version/metadata and dev specifier to match pyproject.toml.
src/typeagent/knowpro/answers.py Adjusts stdlib import ordering at the top of the module.

Comment on lines 4 to 8
import asyncio
import os
from collections.abc import Iterable
from dataclasses import dataclass, field
import os
from typing import Any
Comment thread AGENTS.md
- Avoid potential import cycles between conversation orchestration and pipeline modules by using neutral payload protocols/arguments instead of importing concrete pipeline result classes across modules.
- Prefer ordinal type aliases (e.g., `MessageOrdinal`, `ChunkOrdinal`) over raw `int` in pipeline code for readability.
- When the user asks to "fix the test only", update tests/mocks first and avoid adding production compatibility fallbacks unless explicitly requested.
- For date/time range handling, use the half-open interval convention `[start, stop)` (stop is exclusive), as agreed in PR #198 — this avoids the ambiguity of an inclusive end (e.g. does "end of day" mean 00:00:00 or 23:59:59.999999?). Prefer this over inclusive-end ranges even when padding the end to end-of-day would also work.
@bmerkle

Copy link
Copy Markdown
Collaborator Author

robgruen would you mind taking a look at this one when you get a chance? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants